import static org.junit.Assert.*;

import org.junit.Before;
import org.junit.Test;


public class HPtest {
	
	Player player;
	
	@Before
	public void setup()
	{
		player = new Player();
	}
	
	@Test
	public void test1() 
	{
		assertEquals("",100,player.getCurrentHP()); //checking HP is set to 100
	}
	
	@Test
	public void test2()
	{
		player.setHP(50);
		assertEquals("",50,player.getCurrentHP());
	}
	
	@Test
	public void test3()
	{
		player.setHP(0);
		assertEquals("",0,player.getCurrentHP());
	}
	
	@Test
	public void test4()
	{
		player.setHP(-12);
		assertEquals("",-12,player.getCurrentHP());
	}
	
	@Test
	public void test5()
	{
		player.setHP(101);
		assertEquals("",101,player.getCurrentHP());
	}
	
	@Test
	public void test6()
	{
		player.takeHit(12, 10);
		assertEquals("",100,player.getCurrentHP());
	}
	
	@Test 
	public void test7()
	{
		player.takeHit(49, 10);
		assertEquals("",100,player.getCurrentHP());
	}
	
	@Test
	public void test8()
	{
		player.takeHit(50, 10);
		assertEquals("",100,player.getCurrentHP());
	}
	
	@Test
	public void test9()
	{
		player.takeHit(51, 10);
		assertEquals("",90,player.getCurrentHP());
	}
	
	@Test
	public void test10()
	{
		player.takeHit(70, 10);
		assertEquals("",90,player.getCurrentHP());
	}
	
	@Test
	public void test11()
	{
		player.takeHit(70, 0);
		assertEquals("",100,player.getCurrentHP());
	}
	
	@Test
	public void test12()
	{
		player.takeHit(70, 25);
		assertEquals("",75,player.getCurrentHP());
	}
	
	@Test
	public void test13()
	{
		player.takeHit(70, 99);
		assertEquals("",1,player.getCurrentHP());
	}
	
	@Test
	public void test14()
	{
		player.takeHit(70, 101);
		assertEquals("",-1,player.getCurrentHP());
	}
	
	@Test
	public void test14a()
	{
		player.takeHit(70, -3);
		assertEquals("",100,player.getCurrentHP());
	}
	
	@Test
	public void test15()
	{
		player.setHP(80);
		player.heal(10);
		assertEquals("",90,player.getCurrentHP());
	}
	
	@Test
	public void test16()
	{
		player.setHP(80);
		player.heal(20);
		assertEquals("",100,player.getCurrentHP());
	}
	
	@Test
	public void test17()
	{
		player.setHP(80);
		player.heal(25);
		assertEquals("",100,player.getCurrentHP());
	}
	
	@Test
	public void test18()
	{
		player.setHP(100);
		player.heal(10);
		assertEquals("",100,player.getCurrentHP());
	}
	
	@Test
	public void test19()
	{
		player.setHP(-1);
		player.heal(40);
		assertEquals("",39,player.getCurrentHP());
	}
	
	@Test
	public void test20()
	{
		player.setHP(-1);
		player.heal(9001);
		assertEquals("",100,player.getCurrentHP());
	}
	
	public void test20a()
	{
		player.setHP(80);
		player.heal(-7);
		assertEquals("",80,player.getCurrentHP());
	}
	
	public void test21()
	{
		player.setHP(80);
		player.fullHeal();
		assertEquals("",100,player.getCurrentHP());
	}
	
	@Test
	public void test22()
	{
		player.takeHit(100,20);
		assertEquals("",80,player.getCurrentHP());
		player.endTurn();
		assertEquals("",81,player.getCurrentHP());
		player.endTurn();
		assertEquals("",82,player.getCurrentHP());
		player.endTurn();
		assertEquals("",83,player.getCurrentHP());
		player.endTurn();
		assertEquals("",85,player.getCurrentHP());
		player.endTurn();
		assertEquals("",86,player.getCurrentHP());
	}
	
	@Test
	public void test23()
	{
		player.setHP(95);
		assertEquals("",95,player.getCurrentHP());
		player.endTurn();
		assertEquals("",96,player.getCurrentHP());
		player.endTurn();
		assertEquals("",97,player.getCurrentHP());
		player.endTurn();
		assertEquals("",98,player.getCurrentHP());
		player.endTurn();
		assertEquals("",100,player.getCurrentHP());
		player.endTurn();
		assertEquals("",100,player.getCurrentHP());
		player.endTurn();
	}
	
	@Test
	public void test24()
	{
		player.takeHit(100,20);
		assertEquals("",80,player.getCurrentHP());
		player.heal(10);
		assertEquals("",90,player.getCurrentHP());
		player.takeHit(100, 20);
		assertEquals("",70,player.getCurrentHP());
		player.heal(10);
		assertEquals("",80,player.getCurrentHP());
		player.heal(15);
		assertEquals("",95,player.getCurrentHP());
		player.heal(10);
		assertEquals("",98,player.getCurrentHP());
		player.takeHit(100, 10);
		assertEquals("",88,player.getCurrentHP());
		player.heal(10);
		assertEquals("",97,player.getCurrentHP());
	}
}
